/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jollylengkono.skripsi.CollaborativeWorksComment.action;

import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jollylengkono.skripsi.dao.CollaborativeWorksCommentDao;
import jollylengkono.skripsi.model.CollaborativeWorksComment;
import jollylengkono.skripsi.model.Members;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author hp02
 */
public class CollaborativeWorksCommentGetListByCommentator extends Action {

//    private String forward;
    
    public CollaborativeWorksCommentGetListByCommentator() {
    }

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, 
            HttpServletRequest request, HttpServletResponse response) {
        HttpSession sess = request.getSession(true);
        Members member = (Members) sess.getAttribute("memberSessObject");
        List<CollaborativeWorksComment> comments = new ArrayList<CollaborativeWorksComment>();
        
        comments = new CollaborativeWorksCommentDao().getListByCommentator(member.getId());
        request.setAttribute("comments", comments);
        
        return mapping.findForward("success");
    }
    
    

}
